(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/Script/colider/Failed.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, '58fd4uW5BNKY5ZhIll6GT9a', 'Failed', __filename);
// Script/colider/Failed.ts

Object.defineProperty(exports, "__esModule", { value: true });
var startGame_1 = require("../gameSwitch/startGame");
var Constant_1 = require("../constant/Constant");
// Learn TypeScript:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/typescript.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.eventSys = null;
        _this.scoreAddNode = null;
        return _this;
        // update (dt) {}
    }
    NewClass.prototype.start = function () {
    };
    NewClass.prototype.onCollisionEnter = function (other) {
        var thisSco = Constant_1.Constant.NOW_SCORE;
        if (other.node.name == "Left" || other.node.name == "Right") {
            if (thisSco > Constant_1.Constant.PLAYER_SCORE)
                Constant_1.Constant.PLAYER_SCORE = thisSco; //记录最高分数
            this.eventSys.getComponent(startGame_1.default).gameFailed();
        }
    };
    NewClass.prototype.onCollisionExit = function (other) {
        // cc.log("exit" + other.name);
        // let name = other.name;
        // if (name == "left" || name == "right") {
        //     cc.log("exit");
        // }
    };
    NewClass.prototype.onCollisionStay = function (other) {
        // cc.log("stay" + other.name);
        // let name = other.name;
        // if (name == "left" || name == "right") {
        //     cc.log("stay");
        // }
    };
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "eventSys", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "scoreAddNode", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=Failed.js.map
        